import { Component } from 'react'
import { observer, inject } from 'mobx-react'
import { Typography } from 'antd'

// 将store注入到组件中 - store 值和外层 Provider 一致
@inject('store') // 允许同时传入多个 store - @inject('store1','store2')
@observer // 将类组件包装成响应式组件
class Child extends Component<any, any> {
	render() {
		const { store } = this.props
		const { list } = store
		return <Typography.Text>{list.length}</Typography.Text>
	}
}

export default Child
